﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using MovieBuddy.Controllers;

namespace MovieBuddy.Dialogs
{
    /// <summary>
    /// Interaction logic for OptionsDialog.xaml
    /// </summary>
    public partial class OptionsDialog : Window
    {
        private readonly OptionsDialogController controller;

        public OptionsDialog(OptionsDialogController controller)
        {
            this.controller = controller;
            InitializeComponent();
        }

        public string MovieDetectionFolder
        {
            get
            {
                return MovieDetectionPicker.FileName;
            }
            set
            {
                MovieDetectionPicker.FileName = value;
            }
        }

        public string OverrideDataDirectory
        {
            get
            {
                return DataFolder.FileName;
            }
            set
            {
                DataFolder.FileName = value;
            }
        }

        private void CancelPressed(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }

        private void SavePressed(object sender, RoutedEventArgs e)
        {
            if (controller.VerifyValues())
            {
                DialogResult = true;
                Close();
            }
        }
    }
}
